package com.ics.sapecit.web.action;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.ics.sapecit.bean.User;
import com.ics.sapecit.service.IUserService;
import com.opensymphony.xwork2.ActionSupport;

public class UserManagerAction extends ActionSupport {
	private static final long serialVersionUID = 4828875707900176777L;
	private Logger logger = Logger.getLogger(this.getClass());
	private IUserService userService;
	private List<User> users = new ArrayList<User>();
	private User user;
	
	public String list() {
		users = userService.findUsers();
		return SUCCESS;
	}
	
	public String register() {
		userService.add(user);
		return "register.success";
	}

	public IUserService getUserService() {
		return userService;
	}

	public void setUserService(IUserService userService) {
		this.userService = userService;
	}

	public List<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
}
